﻿namespace TrainingData.Common.Model

open System
open TrainingData.Common.UnitsOfMeasure

type DataType =
    | HeartRate of decimal<beat/min>
    | RunCadence of decimal<steps/min>
    | Speed of decimal<km/h>
    | BikeCadence of decimal<rev/min>
    | Power of decimal<W> * decimal option

type Position = {
    Latitude : decimal<DegLat>
    Longitude : decimal<DegLon>
    Altitude : decimal<m> option
}

type Point = {
    Timestamp : DateTime
    Position : Position option
    Distance : decimal<m> option
    Data : DataType list
}

type Lap = {
    StartTime : DateTime
    Time : TimeSpan
    Distance : decimal<m> option
    Calories : decimal<cal> option
    Data : Point list
}

type Activity = {
    Sport : string
    Id : string
    Laps : Lap list
}

type Session = {
    Activities : Activity list
}
